<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>首页</h1>
<div>
    <div th:if="${session.loginUser == null}" >
        <a  th:href="@{/toLogin}">登录</a>
    </div>
    <div th:if="${session.loginUser != null}" >
        <span>用户：[[${session.loginUser.name}]]</span>
        <a th:href="@{/logout}">注销</a>
    </div>
</div>
<div th:text="${msg}"></div>
<hr>
<a shiro:hasPermission="user:add" th:href="@{/user/add}">add</a>
<a shiro:hasPermission="user:update" th:href="@{/user/update}">update</a>
</body>
</html>